<?php 

namespace pmvc\mvc;

use pmvc\ioc\Ordered;
use pmvc\ioc\OrderUtil;

/**
 * An object that has been mapped.
 *
 */
class MappedObject
	implements Ordered {
	
	private $object;
	private $mapping;
	private $order;

	public function __construct(&$object, $mapping, $order=null) {
		$this->object 	= $object;
		$this->mapping	= $mapping;
		$this->order	= isset($order) ? $order : OrderUtil::getOrder($object);
	}

	/**
	 * Returns the object that was mapped.
	 */
	public function getObject() {
		return $this->object;
	}

	/**
	 * Returns the mapping that mapped
	 * the object.
	 */
	public function getMapping() {
		return $this->mapping;
	}

	/**
	 * {@inheritDoc}
	 */
	public function getOrder() {
		return $this->order;
	}
	
}
?>